kGradientTransitionType ('matt')
The gradient wipe effect uses a matte image to create a transition between two source images. The transition from source 'A' to source 'B' will occur first where the matte image is darkest, last where the matte image is brightest.
During the effect, if the luminance value of the matte image at a given point is greater than the alpha threshold for the effect, the pixel from source 'A' is displayed. If the matte image's luminance value at that point is less than the alpha threshold, the pixel from source 'B' is displayed.
The alpha threshold increases as the effect progresses, eventually causing it to be higher than the luminance value of the matte image at all points, so that only the pixels from source 'B' are displayed.
The equation for the change in the alpha threshold as the effect progresses is:
alphaTheshold = (percent_complete / 100) * 255
so the alpha threshold goes from 0 to 255 over the course of the effect.
The algorithm used to animate the transition is:
for (y=0; y<height; y++) {
for (x=0; x<width; x++) {
if (matte_image_luminiance(x,y) > alphaThreshold)
output pixel source_A(x,y)
else
output pixel source_B(x,y)
}
}
The example above uses a matte image of Shakespeare to control the transition from source `A' to source `B'.
The gradient wipe effect takes two sources and has two parameters.
Use the descriptions below to help you understand what the parameters do. To learn how to use parameter atoms, see "Adding Video Effects to a QuickTime Movie"
| Previous | Chapter Contents | Chapter Top | Next |